const log4js = require("log4js");

log4js.configure({
  appenders: {
    deepLink: {
      type: "file",
      filename: "logs/mylog",
    },
    stdout: {
      type: "stdout",
    },
  },
  categories: {
    default: {
      appenders: ["deepLink", "stdout"],
      level: "debug",
    },
  },
  pm2: true,
  disableClustering: true,
});

const logger = log4js.getLogger("default");

//重新写了info方法
function info(message) {
  logger.info(message);
}

exports.logger = logger;
exports.log4js = log4js;
exports.info = info;
